package com.bsoft.gol.hcs.specialist.service;

import com.github.pagehelper.PageInfo;
import ctd.controller.exception.ControllerException;
import ctd.util.annotation.RpcService;
import com.bsoft.gol.hcs.followup.bean.request.DeleteFollowUpFormDTO;
import com.bsoft.gol.hcs.followup.bean.request.FollowUpQuestionnaireDTO;
import com.bsoft.gol.hcs.followup.bean.request.SaveFollowUpFormDTO;
import com.bsoft.gol.hcs.followup.bean.response.AuthFollowUpRouteVO;
import com.bsoft.gol.hcs.followup.bean.response.HangUpFollowUpListVO;
import hcn.specialist.DiseaseSpecies;
import com.bsoft.gol.hcs.satisfaction.bean.vo.QueryRouteQuestionListVO;
import com.bsoft.gol.hcs.specialist.bean.request.*;
import com.bsoft.gol.hcs.specialist.bean.response.FormFillingInfoResponse;
import com.bsoft.gol.hcs.specialist.bean.response.PatientMedicalDataCollectResponse;
import com.bsoft.gol.hcs.specialist.bean.response.QueryExecutionListResponse;
import com.bsoft.gol.hcs.specialist.bean.vo.FollowUpRecordsVO;
import com.bsoft.gol.hcs.specialist.entity.*;

import java.util.List;


/**
 * @author tongtp
 * @version v0.1
 * @className IFollowUpPlanService
 * @description 随访计划服务
 * @create 2020-07-21 14:18
 **/
public interface IFollowUpPlanService {

	/**
	 * @param request
	 * @throws
	 * @description: 新增随访计划记录
	 * @return: org.atag.core.base.BaseResponse
	 * @author: tongtp
	 * @date: 2020/8/11 9:25
	 */
	@RpcService
	List<Long> addExecutionList(AddExecutionListRequest request)throws ControllerException;

    @RpcService
    List<Long> addPlan(AddFusPlanRequest request);

    List<AuthFollowUpRouteVO> getDiseaseRoute(Long diseaseTypeId) throws ControllerException;

    /**
	 * 根据路径id查询其所有子路径中包含的表单与宣教信息
	 */
	@RpcService
	QueryRouteQuestionListVO getRouteForm(Long routeId);

	/**
	 * @param request
	 * @param diseaseSpecies
	 * @param fusTeamChronicGroupRecord
	 * @param advanceNotifyDate
	 * @throws
	 * @description: 保存随访计划记录
	 * @return: specialist.entity.FollowUpRecords
	 * @author: tongtp
	 * @date: 2020/8/11 16:08
	 */
	FollowUpRecords saveFollowUpRecords(AddExecutionListRequest request, DiseaseSpecies diseaseSpecies,
											   FusTeamChronicGroupRecordEntity fusTeamChronicGroupRecord,
											   Integer advanceNotifyDate) throws ControllerException;

	/**
	 * @param request
	 * @throws
	 * @description: 生成随访计划记录
	 * @return: org.atag.core.base.BaseResponse
	 * @author: tongtp
	 * @date: 2020/7/21 14:19
	 */
	@RpcService
	String produceExecutionList(ProduceExecutionListRequest request) throws ControllerException;

	/**
	 * @param
	 * @throws
	 * @description: 自动终止随访计划
	 * @return: org.atag.core.base.BaseResponse
	 * @author: tongtp
	 * @date: 2020/7/29 17:47
	 */
	@RpcService
	String autoStopExecutionList() throws ControllerException;

	/**
	 * @param
	 * @throws
	 * @description: 生成所有随访计划记录
	 * @return: org.atag.core.base.BaseResponse
	 * @author: tongtp
	 * @date: 2020/7/21 14:31
	 */
	@RpcService
	void produceExecutionListAll() throws ControllerException;

	/**
	 * @param request
	 * @throws
	 * @description: 获取随访计划记录
	 * @return: org.atag.core.base.BaseResponse
	 * @author: tongtp
	 * @date: 2020/7/21 14:19
	 */
	@RpcService
	QueryExecutionListResponse queryExecutionList(QueryExecutionListRequest request) throws ControllerException;

	/**
	 * 获取随访计划详情
	 *
	 * @param request 随访id
	 * @return 随访详情
	 */
	@RpcService
	FollowUpRecordsVO queryFollowUpDetail(QueryDoctorFollowupReq request);

	/**
	 * 随访计划设置-医生站嵌入查询
	 * @param request
	 */
	@RpcService
//	BaseResponse queryFollowUpPathSetting(QueryFollowUpPathRouteRequest request) throws ControllerException;
	FollowUpPathRouteDTO queryFollowUpPathSetting(QueryFollowUpPathRouteRequest request) throws ControllerException;

	/**
	 * 随访计划设置-医生站嵌入-保存
	 * @param request
	 */
	@RpcService
	void saveFollowUpPathSetting(SaveFollowUpPathRouteRequest request) throws ControllerException;

	/**
	 * @param request
	 * @throws
	 * @description: 保存随访结果
	 * @return: org.atag.core.base.BaseResponse
	 * @author: tongtp
	 * @date: 2020/7/21 14:19
	 */
	@RpcService
	void saveFollowUpResult(SaveFollowUpResultRequest request) throws ControllerException;

    @RpcService
    void saveHmFollowUpResult(SaveFollowUpResultRequest request) throws ControllerException;

    /**
	 * @param request
	 * @throws
	 * @description: 终止随访计划
	 * @return: org.atag.core.base.BaseResponse
	 * @author: tongtp
	 * @date: 2020/7/23 10:39
	 */
	@RpcService
	void stopExecutionList(StopExecutionListRequest request) throws ControllerException;

    @RpcService
    void stopAllExecutionList(StopAllExecutionListRequest request) throws ControllerException;

    void createNextFollowUpRecords(FollowUpRecords followUpRecords) throws ControllerException;

    /**
	 * @param request
	 * @throws
	 * @description: 用户端查看随访计划更新状态
	 * @return: org.atag.core.base.BaseResponse
	 * @author: liwl
	 * @date: 2020/10/9 10:39
	 */
	@RpcService
	void readFollowUpPlan(StopExecutionListRequest request) throws ControllerException;

	@RpcService
	PageInfo queryExecutionListByPatient(QueryExecutionListByPatientReq byPatientReq) throws ControllerException;

	/**
	 * 随访任务定时器
	 */
	 void autoFollowUpRecords() throws ControllerException;



	 /**
	 * 根据随访计划id和宣教id更新宣教阅读状态
	 * @param   resultRequest
	 */
	@RpcService
	void updateFollowUpContentStatus(SaveFollowUpResultRequest resultRequest) throws ControllerException;

	/**
	 * 根据随访计划id更新随访计划异常查看状态为已读状态
	 * @param   resultRequest
	 */
	@RpcService
	void updateAbnormalReadFlag(SaveFollowUpResultRequest resultRequest);

	/**
	 * 批量更新随访状态
	 *
	 * @param resultRequest
	 */
	@RpcService
	void batchUpdateFollowUpContentStatus(SaveFollowUpResultRequest resultRequest) throws ControllerException;

	/**
	 * 根据随访计划id查询健康宣教
	 *
	 * @param request 随访计划id
	 * @return 健康宣教
	 */
	@RpcService
	List<FollowUpRecordsEducation> queryFollowUpContentById(SaveFollowUpResultRequest request);

	/**
	 * 查询随访记录关联的门诊或住院记录列表
	 *
	 * @param request 入参
	 * @return 记录信息列表
	 */
	@RpcService
	List<PatientMedicalDataCollectResponse> queryVisitMedicalList(PatientMedicalDataRequest request);

	/**
	 * 查询门诊、住院记录Id查询门诊、住院表单填写的信息
	 *
	 * @param request 入参
	 * @return 记录信息列表
	 */
	@RpcService
	FormFillingInfoResponse queryFormFillingInfoList(PatientMedicalDataRequest request);

    @RpcService
    void hangUpPlan(FollowUpHangUpDTO dto);

    @RpcService
    List<HangUpFollowUpListVO> hangUpRecords(String recordId);

    @RpcService
    FusAfterContacts getContacts(FollowUpQueryContactsDTO dto);

    //保存随访联系人 FollowUpSaveContactsDTO
    @RpcService
    void saveContacts(FollowUpSaveContactsDTO dto);

    //删除随访关联表单
    @RpcService
    void deleteForm(DeleteFollowUpFormDTO dto);

	@RpcService
	void addForm(SaveFollowUpFormDTO dto);

	@RpcService
	void saveForm(FollowUpQuestionnaireDTO dto);
}
